cmake_minimum_required(VERSION 3.8)

project(sweety
        VERSION 2.0.0
        DESCRIPTION "sweety")

# 配置项仅配置 Debug 和 Release，并且默认使用 Debug
set(CMAKE_CONFIGURATION_TYPES Debug Release)
if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Debug)
endif()

set(DEFAULT_BUILD_TYPE "Debug")
if (NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "Choose the type of build" FORCE)
    # Set the possible values of build type for cmake-gui
endif()

set(CMAKE_BUILD_TYPE Debug)

# 设置C++编译选项
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(MSVC)
	add_compile_options("/source-charset:utf-8")
endif(MSVC)

# 添加util文件夹
add_subdirectory(src/)
add_subdirectory(examples/)

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
	add_dependencies(Sample libsweety)
endif()
